/* GUI CONVERTED from rprriq.p (converter v1.75) Sat Aug 12 23:11:40 2000 */
/* rprriq.p - RESOURCE REQUIREMENT INQUIRY                              */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                  */
/* All rights reserved worldwide.  This is an unpublished work.         */
/* web convert rprriq.p (converter v1.00) Fri Oct 10 13:57:59 1997 */
/* web tag in rprriq.p (converter v1.00) Mon Oct 06 14:18:39 1997 */
/*F0PN*/ /*K1D8*/ /*                                                    */
/*V8:ConvertMode=Report                                        */
/* REVISION: 1.0      LAST MODIFIED: 06/12/86   BY: PML */
/* REVISION: 1.0      LAST MODIFIED: 01/17/86   BY: EMB */
/* REVISION: 2.0      LAST MODIFIED: 07/09/87   BY: EMB *A76* */
/* REVISION: 4.0     LAST EDIT: 12/30/87    BY: WUG *A137* */
/* REVISION: 5.0     LAST EDIT: 05/03/89    BY: WUG *B098* */
/* REVISION: 6.0     LAST EDIT: 07/12/90    BY: WUG *D051* */
/* Revision: 7.3     Last edit: 11/19/92        By: jcd *G339* */
/* Revision: 8.6     Last edit: 12/11/97        By: bvm *K1D8* */

/* REVISION: 8.6E     LAST MODIFIED: 02/23/98   BY: *L007* A. Rahane */
/* REVISION: 8.6E     LAST MODIFIED: 10/04/98   BY: *J314* Alfred Tan   */
/* REVISION: 9.1      LAST MODIFIED: 03/24/00   BY: *N08T* Annasaheb Rahane */
/* REVISION: 9.1      LAST MODIFIED: 08/12/00   BY: *N0KP* myb              */

/*K1D8*/ /* DISPLAY TITLE */

/*GUI preprocessor directive settings */
&SCOPED-DEFINE PP_GUI_CONVERT_MODE REPORT

/*K1D8*/ {mfdtitle.i "b+ "}

/* ********** Begin Translatable Strings Definitions ********* */

&SCOPED-DEFINE rprriq_p_1 "Lead Time"
/* MaxLen: Comment: */

&SCOPED-DEFINE rprriq_p_2 "Offset"
/* MaxLen: Comment: */

&SCOPED-DEFINE rprriq_p_3 "Qty Per"
/* MaxLen: Comment: */

&SCOPED-DEFINE rprriq_p_4 "Start"
/* MaxLen: Comment: */

/* ********** End Translatable Strings Definitions ********* */

define variable desc1 like pt_desc1.
define variable part like rq_part.
define variable site like rq_site.
define variable rsc like rq_rsc.
define variable um like rs_um.

/*K1D8* /* DISPLAY TITLE */
 * {mfdtitle.i "b+ "} */

part = global_part.
site = global_site.


/*GUI preprocessor Frame A define */
&SCOPED-DEFINE PP_FRAME_NAME A

FORM /*GUI*/ 
   part
   desc1          no-label
   site
   rsc
with frame a no-underline width 80 attr-space THREE-D /*GUI*/.

/*GUI preprocessor Frame A undefine */
&UNDEFINE PP_FRAME_NAME



/* SET EXTERNAL LABELS */
setFrameLabels(frame a:handle).

/*K1D8*/ {wbrp01.i}

repeat:

/*K1D8*/ if c-application-mode <> 'web' then
     update part site rsc with frame a editing:

      if frame-field = "part" then do:
     /* FIND NEXT/PREVIOUS RECORD */
     {mfnp.i rq_mstr part rq_part part rq_part rq_part}

     if recno <> ? then do:
        desc1 = "".
        find pt_mstr where pt_part = rq_part no-lock no-error.
        if available pt_mstr then desc1 = pt_desc1.
        part = rq_part.
        rsc = "".
        display part desc1 rsc with frame a.
        recno = ?.
     end.
      end.
      else if frame-field = "site" then do:
     /* FIND NEXT/PREVIOUS RECORD */
     {mfnp.i si_mstr site si_site site si_site si_site}
     if recno <> ? then do:
        display si_site @ site with frame a.
     end.
      end.
      else if frame-field = "rsc" then do:
     /* FIND NEXT/PREVIOUS RECORD */
     {mfnp.i rq_mstr rsc rq_rsc rsc rq_rsc rq_rsc}
     if recno <> ? then do:
        rsc = rq_rsc.
        part = "".
        desc1 = "".
        recno = ?.
        display part desc1 rsc with frame a.
     end.
      end.
      else do:
     status input.
     readkey.
     apply lastkey.
      end.
   end.

/*K1D8*/ {wbrp06.i &command = update &fields = "  part site rsc" &frm = "a"}

/*K1D8*/ if (c-application-mode <> 'web') or
/*K1D8*/ (c-application-mode = 'web' and
/*K1D8*/ (c-web-request begins 'data')) then do:

   desc1 = "".
   find pt_mstr where pt_part = part no-lock no-error.
   if available pt_mstr then do:
      desc1 = pt_desc1.
      part = pt_part.
   end.
   display part desc1 with frame a.

   hide frame b.
   hide frame c.
   hide frame d.

/*K1D8*/ end.

   /* SELECT PRINTER */
   {mfselprt.i "terminal" 80}

   if part <> "" then
   for each rq_mstr where (rq_part = part)
   and (rq_site = site)
   and (rq_rsc = rsc or rsc = "" )
   no-lock by rq_rsc by rq_site by rq_end
   with frame b width 80 no-attr-space:
                /* SET EXTERNAL LABELS */
                setFrameLabels(frame b:handle).
                
/*GUI*/ {mfguichk.i } /*Replace mfrpchk*/
         /*G339*/

      um = "".
      find rs_mstr where rs_rsc = rq_rsc and rs_site = rq_site no-lock no-error.
      if available rs_mstr then um = rs_um.

      display rq_part rq_rsc
      um
      rq_qty label {&rprriq_p_3}
/*D051 format "->>>,>>9.99" */
      rq_lead label {&rprriq_p_1} rq_lt_off label {&rprriq_p_2}
      format "->>>>9"
      rq_start label {&rprriq_p_4} rq_end WITH STREAM-IO /*GUI*/ .

   end.

   else if rsc <> "" then
   for each rq_mstr where (rq_rsc = rsc)
   and rq_site = site
   no-lock by rq_part by rq_end
   with frame c width 80 no-attr-space:
                /* SET EXTERNAL LABELS */
                setFrameLabels(frame c:handle).
                
/*GUI*/ {mfguichk.i } /*Replace mfrpchk*/
         /*G339*/

      um = "".
      find rs_mstr where rs_rsc = rq_rsc and rs_site = rq_site no-lock no-error.
      if available rs_mstr then um = rs_um.

      display rq_part rq_rsc
      um
      rq_qty label {&rprriq_p_3}
/*D051 format "->>>,>>9.99" */
      rq_lead label {&rprriq_p_1} rq_lt_off label {&rprriq_p_2}
      format "->>>>9"
      rq_start label {&rprriq_p_4} rq_end WITH STREAM-IO /*GUI*/ .

   end.

   else
   for each rq_mstr no-lock
   where rq_site = site
   by rq_part by rq_site by rq_rsc by rq_end
   with frame d width 80 no-attr-space:
                /* SET EXTERNAL LABELS */
                setFrameLabels(frame d:handle).
                
/*GUI*/ {mfguichk.i } /*Replace mfrpchk*/
         /*G339*/

      um = "".
      find rs_mstr where rs_rsc = rq_rsc and rs_site = rq_site no-lock no-error.
      if available rs_mstr then um = rs_um.

      display rq_part rq_rsc
      um
      rq_qty label {&rprriq_p_3}
/*D051 format "->>>,>>9.99" */
      rq_lead label {&rprriq_p_1} rq_lt_off label {&rprriq_p_2}
      format "->>>>9"
      rq_start label {&rprriq_p_4} rq_end WITH STREAM-IO /*GUI*/ .

   end.

   {mfreset.i}
/*GUI*/ {mfgrptrm.i} /*Report-to-Window*/

   {mfmsg.i 8 1}
end.
global_part = part.

/*K1D8*/ {wbrp04.i &frame-spec = a}
